<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    // 原生JS实现简单map方法
    Array.prototype.myMap = function (CallBack) {
      let res = [];
      for (let index = 0; index < this.length; index++) {
        res.push(CallBack(this[index], index, this));
        // console.log(this.__proto__);
      }
      return res;
    };
    let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
    let res = arr.myMap(function (v) {
      return v * 10;
    });
    console.log(res);
  </script>
</html>
